//
//  CCTextField.m
//  BuDeJie
//
//  Created by demoncraz on 2017/2/12.
//  Copyright © 2017年 demoncraz. All rights reserved.
//

#import "CCTextField.h"
#import "UITextField+Placeholder.h"

@interface CCTextField ()

@end

@implementation CCTextField

- (void)awakeFromNib {
    [super awakeFromNib];
    [self configurate];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self configurate];
    }
    return self;
}


- (void)configurate {
    
    self.tintColor = [UIColor whiteColor];
    self.placeholderColor = [UIColor lightGrayColor];
    [self addTarget:self action:@selector(textBegin) forControlEvents:UIControlEventEditingDidBegin];
    [self addTarget:self action:@selector(textEnd) forControlEvents:UIControlEventEditingDidEnd];
    
}

- (void)textBegin {
    self.placeholderColor = [UIColor whiteColor];
}

- (void)textEnd {
    self.placeholderColor = [UIColor lightGrayColor];
}


@end
